
public class PC_Ctr {
	int instruction;
	int PC;
	int newPC;
	int PC_sel;
	int offset;
	int keep;
	InstructionMemory memory;
	
	void init(InstructionMemory mem){
		memory=mem;
		PC=-4;
		keep=0;
		PC_sel=0;
	}
	void go(){
		if(PC_sel==1){
			newPC=PC+offset;
			System.out.println("!!!!!!!!!!!!!!!!!:"+newPC);
		}else{	
			newPC=PC+4;			
			System.out.println("!!!!!!!!!!!!!!!!!:"+newPC);
		}
	}
	int get_instruction(){	
		if(keep==0)
			PC=newPC;
		instruction=memory.getInstruction(PC);
		return instruction;
	}
	void setKeep(int keep){
        this.keep=keep;
	}
}
